package org.codeart.memento.example01;

public class Client {

    public static void main(String[] args) {
        Originator originator = new Originator();
        originator.setId("1").setName("洛必达").setPhone("5134364364");
        System.out.println(originator);

        Caretaker caretaker = new Caretaker();
        caretaker.setMemento(originator.createMemento());
        
        originator.setName("伯努利");
        System.out.println(originator);
        Memento memo = caretaker.getMemento();
        originator.restore(memo);
        System.out.println(originator);
    }

}
